<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>各种定位</title>
</head>
<style>
  .root {
    width: 1000px;
    height: 800px;
    border: 1px solid #000;
    position: relative;
  }
  .box {
    width: 200px;
    height: 150px;
    border: 1px solid #e33;
  }
  .box1 {
    /* relative相对自身 */
    position: relative;
    top: -10px;
    background-color: red;
  }
  .box2 {
    position: absolute;
    background-color: blue;
    left: 50px;
    top: 30px;
  }
  .box3 {
    /* fixed相对浏览器可视 */
    position: fixed;
    background-color: yellow;
    bottom: 0;
    right: 0;
  }
  .box4 {
    /* 默认 正常 */
    position: static;
  }
</style>
<body>
  <div class="root">
    <div class="box box1">box1</div>
    <div class="box box2">box2</div>
    <div class="box box3">box3</div>
    <div class="box box4">box4</div>
  </div>
</body>
</html>